import HmArticle from "@/views/HmArticle.vue";
import HmCollect from "@/views/HmCollect.vue";
import HmDetail from "@/views/HmDetail.vue";
import HmLayout from "@/views/HmLayout.vue";
import HmLike from "@/views/HmLike.vue";
import HmLogin from "@/views/HmLogin.vue";
import HmNew from "@/views/HmNew.vue";
import HmRegister from "@/views/HmRegister.vue";
import HmTui from "@/views/HmTui.vue";
import HmUser from "@/views/HmUser.vue";
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const router = new VueRouter({
  routes: [
    {
      path: "/login",
      component: HmLogin,
    },
    {
      path: "/register",
      component: HmRegister,
    },
    {
      path: "/detail",
      component: HmDetail,
    },
    {
        path:"/detail/:id",
        component: HmDetail,
    },
    // {
    //     path:"/login/:username",
    //     component: HmLogin
    // },
    {
      path: "/layout",
      component: HmLayout,
      children: [
        {
          path: "/layout/article",
          component: HmArticle,
          children:[
            {
                path:"/layout/article/new",
                component: HmNew
            },
            {
                path:"/layout/article/tuijian",
                component: HmTui
            },
            {
                path:"/layout/article/",
                component: HmTui
            }
          ]
        },
        {
          path: "/layout/collect",
          component: HmCollect,
        },
        {
          path: "/layout/like",
          component: HmLike,
        },
        {
          path: "/layout/user",
          component: HmUser,
        },
        
        {
          path: "/layout",
          redirect: "/layout/article",
        },
      ],
    },
    {
      path: "/",
      redirect: "/login",
    },
  ],
  mode: "history",
  linkActiveClass: "active",
  linkExactActiveClass: "ex-active",
});
export default router;
